package com.ruoyi.tea.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tea.mapper.TeaProposalMapper;
import com.ruoyi.tea.domain.TeaProposal;
import com.ruoyi.tea.service.ITeaProposalService;
import com.ruoyi.common.core.text.Convert;

/**
 * 意见反馈Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-31
 */
@Service
public class TeaProposalServiceImpl implements ITeaProposalService 
{
    @Autowired
    private TeaProposalMapper teaProposalMapper;

    /**
     * 查询意见反馈
     * 
     * @param id 意见反馈主键
     * @return 意见反馈
     */
    @Override
    public TeaProposal selectTeaProposalById(Long id)
    {
        return teaProposalMapper.selectTeaProposalById(id);
    }

    /**
     * 查询意见反馈列表
     * 
     * @param teaProposal 意见反馈
     * @return 意见反馈
     */
    @Override
    public List<TeaProposal> selectTeaProposalList(TeaProposal teaProposal)
    {
        return teaProposalMapper.selectTeaProposalList(teaProposal);
    }

    /**
     * 新增意见反馈
     * 
     * @param teaProposal 意见反馈
     * @return 结果
     */
    @Override
    public int insertTeaProposal(TeaProposal teaProposal)
    {
        teaProposal.setCreateTime(DateUtils.getNowDate());
        return teaProposalMapper.insertTeaProposal(teaProposal);
    }

    /**
     * 修改意见反馈
     * 
     * @param teaProposal 意见反馈
     * @return 结果
     */
    @Override
    public int updateTeaProposal(TeaProposal teaProposal)
    {
        return teaProposalMapper.updateTeaProposal(teaProposal);
    }

    /**
     * 批量删除意见反馈
     * 
     * @param ids 需要删除的意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteTeaProposalByIds(String ids)
    {
        return teaProposalMapper.deleteTeaProposalByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除意见反馈信息
     * 
     * @param id 意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteTeaProposalById(Long id)
    {
        return teaProposalMapper.deleteTeaProposalById(id);
    }
}
